<?php
App::uses( 'MemberAppModel', 'Model');

class Category extends AppModel {
    var $name = 'Category';

    var $validate = array(
        'name' => array(
            'notempty' => array(
                'rule' => array('notempty'),
                'message' => 'Tên là bắt buộc',
                'allowEmpty' => false,
                'required' => true,
            ),

            'maxlength' => array(
                'rule' => array('maxlength', 255),
                'message' => 'Tên quá 255 ký tự',
                'allowEmpty' => false,
                'required' => true,
            ),
        )
    );


	/**
	 * Get all list
	 *
	 * @param type  meta
	 * @return type  meta
	 * @access public
	 */
	function getList()
	{
		return $this->find('list', array(
			'fields' => array('id', 'name'),
			'conditions' => array('status' => 4)
		));
	}
}
